<div th:replace="common/IncludeTop">
</div>
<div id="Content">
  <div id="BackLink">
    <a href="/catalog/view">Return to Main Menu</a>
  </div>
  <div id="Catalog">

    <table>
          <h2>Checkout Summary</h2>
            <tr>
              <td><b>Item ID</b></td>
              <td><b>Product ID</b></td>
              <td><b>Description</b></td>
              <td><b>In Stock?</b></td>
              <td><b>Quantity</b></td>
              <td><b>List Price</b></td>
              <td><b>Total Cost</b></td>
            </tr>
            <tr th:each ="item:${cart.getCartItems()}">
              <td>
                <a th:href="'viewItem?itemId=' + ${item.getItem().getItemId()}" th:text="${item.getItem().getItemId()}"></a>
              </td>
              <td>
                <span th:text="${item.getItem().getProductId()}"></span>
              </td>
              <td>
                <span th:if="${item.getItem().getAttribute1()} != null" th:text="${item.getItem().getAttribute1()}"></span>
                <span th:if="${item.getItem().getAttribute2()} != null" th:text="${item.getItem().getAttribute2()}"></span>
                <span th:if="${item.getItem().getAttribute3()} != null" th:text="${item.getItem().getAttribute3()}"></span>
                <span th:if="${item.getItem().getAttribute4()} != null" th:text="${item.getItem().getAttribute4()}"></span>
                <span th:if="${item.getItem().getAttribute5()} != null" th:text="${item.getItem().getAttribute5()}"></span>
                <span th:if="${item.getItem().getProduct().getName()} != null" th:text="${item.getItem().getProduct().getName()}"></span>
              </td>
              <td>
                <label th:text="${item.isInStock()}" ></label>
              </td>
              <td>
                <label  th:text="${item.getQuantity()}" ></label> <!--onblur="updateCart();"-->
              </td>

              <td th:text="'$' + ${#numbers.formatDecimal(item.getItem().getListPrice(), 1, 2)}"></td>


              <td th:text="'$' + ${#numbers.formatDecimal(item.getTotal(), 1, 2)}"></td>

            </tr>

              <td colspan="7">
                <label>Sub Total:<span th:text="'$' + ${#numbers.formatDecimal(cart.getSubTotal(), 1, 2)}"></span></label>
              </td>
<!--                <button onclick="window.location.href='/order/newOrderForm';">Checkout</button>-->
    </table>
    <input type="submit" onclick="window.location.href='/order/newOrderForm';" value="Checkout" />
  </div>
</div>
<div th:replace="common/IncludeBottom">
</div>
